import { WithId, Document, Db } from 'mongodb';
import MongoDBClient from '../db';

export function getDatabase(db: string): Promise<Db> {
  return MongoDBClient.getDatabase(db);
}

export function getDocs(db: string, collection: string):Promise<WithId<Document>[]> {
  return MongoDBClient.getDocs(db, collection);
}

export function addDoc(db: string, collection: string, doc: Document):Promise<void> {
  return MongoDBClient.addDoc(db, collection, doc);
}

export default { getDocs };
